import api from '@/services/merchant-account/group-user/funds';

export type MerchantAccountGroupUserFundsList = MerchantAccountGroupUserFundsApi.ListResponse;
export const getFilterList = async () => {
  const res = await api.getFilterList();
  return res.data;
};
export const getList = async (params: MerchantAccountGroupUserFundsApi.ListParams) => {
  const res = await api.getList<MerchantAccountGroupUserFundsList>(params);
  const tableData: Requestor.TableFormatedData<MerchantAccountGroupUserFundsList> = {
    data: res.listData,
    current: res.page + 1,
    pageSize: res.limit,
    total: res.count,
    success: res.success,
  };

  return tableData;
};

export default {
  getFilterList,
  getList,
};
